package com.whynot.frame.basic.common;

public class UserThreadLocal {

    //把构造函数私有，外面不能new，只能通过下面两个方法操作
    private UserThreadLocal(){

    }

    private static final ThreadLocal<String> LOCAL = new ThreadLocal<String>();
    private static final ThreadLocal<String> TOKEN = new ThreadLocal<String>();
    public static void set(String acctId){
        LOCAL.set(acctId);
    }

    public static String getUserId(){
        return LOCAL.get();
    }

    public static void setToken(String token){
        TOKEN.set(token);
    }
    public static String getToken(){
        return TOKEN.get();
    }
}